//
//  SNTitleView.m
//  ZhuoxinAgriculture
//
//  Created by stone on 16/12/16.
//  Copyright © 2016年 stone. All rights reserved.
//

#import "SNTitleView.h"

@interface SNTitleView()
/** leftLabel */
@property (weak, nonatomic) UILabel * leftLabel;
/** middleLabel */
@property (weak, nonatomic) UILabel * middleLabel;
/** rightLabel */
@property (weak, nonatomic) UILabel * rightLabel;


@end
@implementation SNTitleView

- (instancetype)initWithFrame:(CGRect)frame USERTYPE:(NSString*)USERTYPE
{
    self = [super initWithFrame:frame];
    if (self) {
        [self addViewsWithUSERTYPE:USERTYPE];
        [self setupUIWithUSERTYPE:USERTYPE];

    }
    return self;
}
- (void)foo1
{
    
}
- (void)foo2
{
    UILabel * leftLabel = ({
        UILabel * label = [[UILabel alloc] init];
        /** GPU 优化 */
//        label.opaque = YES;
//        label.backgroundColor = [UIColor whiteColor];
//        label.layer.masksToBounds = YES;
        //------------------------------
        label.numberOfLines = 0;
        label.textColor = [UIColor blackColor];
        label.textAlignment = NSTextAlignmentCenter;
        label.text = @"Label的默认内容";
        label.font = [UIFont systemFontOfSize:15];
        
         [self addSubview:label];
        

        label;
    });
    self.leftLabel = leftLabel;
}
- (void)addViewsWithUSERTYPE:(NSString*)USERTYPE
{
    switch (USERTYPE.integerValue) {
        case 1:
            [self foo1];
            break;
        case 5:
        case 6:
            [self foo2];
            break;
            
        default:
            break;
    }
}
- (void)setupUIWithUSERTYPE:(NSString*)USERTYPE
{
    
}
@end
